package com.nip.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

import com.nip.common.Constant;
import com.nip.miniproject_02.R;

/**
 * Main
 * 
 * @author NIP-ThangNM
 * 
 */
public class AcvivityResult extends Activity {
	private EditText edText;
	private Button btnSend;
	private Intent intent;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.result_activity);
		edText = (EditText) findViewById(R.id.edText1);
		btnSend = (Button) findViewById(R.id.btnSendToA);
		intent = getIntent();
		Bundle bundle = intent.getExtras();

		String text = bundle.getString(Constant.SEND_CODE_01);
		edText.setText(text);

		btnSend.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub

				intent.putExtra(Constant.SEND_CODE_02, edText.getText()
						.toString());
				setResult(Constant.RESULT_CODE_01, intent);
				finish();
			}
		});
	}

}
